<template>
   <view class="container">
 	  <view class="img">
 	  	<image :src="picurl" mode="aspectFill"></image>
 	  </view>
 	
     <view class="btn" @click="back">返</view>

	 	 <text>{{this.user.name}}</text>

	
   </view>
 </template>
  
 <script>

   export default {
 	  data(){
 		  return{
			  id:"",
 			  picurl:"",
			user:[],
			userId:'',
			username:'',
			  
 		  };
 	  },
	    
	
     methods: {
       back() {
         uni.request({
 				url:'http://43.136.172.73/api/v1/commodity/category/list',
			method:'GET',
			
			header:{
				'Authorization':'sfsdf'
			},
 			success:(res)=>{
				console.log(res);
			
 				//this.picurl=res.data.message
 			},
			fail:(err)=>{
				console.error(err);
			}
 		}) 
       
       }
     },
	 mounted() {
	 	
	 	//全局变量用户ID
	 //	this.userId = uni.getStorageSync('userId');
	 		this.user = uni.getStorageSync('user');
	 		//this.userName = uni.getStorageSync('user.name');
	 		console.log('555',this.user)
			  	this.userId = uni.getStorageSync('userId');
				
	 	//this.address();
	 },
	
 	onload(){
 		this.back()
 	}
   }
 </script>
  
 <style>
   .container {
     display: flex;
     justify-content: center;
     align-items: center;
     flex-direction: column;
     height: 100vh;
   }
   .img{
   	padding-top: 70rpx;
   	padding-bottom: 80rpx;
   	display: flex;
   	justify-content: center;
   	
   }
   .btn {
     margin: 10px;
     padding: 10px;
     border: 1px solid #ccc;
     border-radius: 5px;
     cursor: pointer;
   }
 </style>
 
 
 

